package com.zjun.demo.experimentaldemo.base

import android.os.Bundle
import android.os.PersistableBundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.zjun.demo.experimentaldemo.BR
import com.zjun.demo.experimentaldemo.R

abstract class BaseActivity<T : ViewDataBinding>: AppCompatActivity(),View.OnClickListener {

    lateinit var mBinding:T

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = DataBindingUtil.setContentView(this,getLayoutId())
        mBinding.setVariable(BR.listener, this)
        initialize()
    }

    abstract fun initialize()

    abstract fun getLayoutId():Int

    override fun onClick(v:View){}


    override fun overridePendingTransition(enterAnim: Int, exitAnim: Int) {
        super.overridePendingTransition(enterAnim, exitAnim)
    }


}